package com.springcould.commodity.controller;

import com.springcould.commodity.repoit.ProductInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.springcould.commodity.entity.Category;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@RestController
public class CommodityController {
    /**
     * 商品
     */
    @Autowired
    private ProductInfo  productInfo;
    @RequestMapping("/getUserById")
    public List<Category> getUserById(@RequestBody List<String> CategoryList) {
//        @RequestParam("id") String id
//        List<Category> list= productInfo.findByTest(id);
        List<Category> list=productInfo.findByTest(CategoryList);
//        category category=new category();
//        category.setId("10");
//        category.setName("dsad");
//        category.setTest("ddsad");
//        productInfo.save(category);
        return list;
    }
    @RequestMapping("/test")
    public String getUserById2() {
        return "Return Test Msg";
    }

}
